// p2p_test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "../../include/p2p_interface.hpp"
#include "P2PSessionMgr.h"
#include <WinSock2.h>

#pragma comment(lib, "ws2_32.lib")

#ifdef _DEBUG
#pragma comment(lib, "../../lib/p2pclientd.lib")
#pragma comment(lib, "../../lib/netd.lib")
#pragma comment(lib, "../../lib/iocpd.lib")
#pragma comment(lib, "../../lib/timerd.lib")
#pragma comment(lib, "../../lib/logd.lib")
#pragma comment(lib, "../../lib/filelogd.lib")
#pragma comment(lib, "../../lib/utilityd.lib")
#else
#pragma comment(lib, "../../lib/p2pclient.lib")
#pragma comment(lib, "../../lib/net.lib")
#pragma comment(lib, "../../lib/iocp.lib")
#pragma comment(lib, "../../lib/timer.lib")
#pragma comment(lib, "../../lib/log.lib")
#pragma comment(lib, "../../lib/filelog.lib")
#pragma comment(lib, "../../lib/utility.lib")
#endif


int _tmain(int argc, _TCHAR* argv[])
{
    CP2PSessionMgr p2p_session_mgr;

    IP2P* p2p = CreateP2PClient(&p2p_session_mgr);

    p2p->Login("42.121.89.188", 42158, 42159);

    while (true)
    {
        if (!p2p->Run())
        {
            Sleep(1);
        }
    }

	return 0;
}

